package com.netease.financial.base.register;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.widget.Button;
import android.widget.CheckBox;
import android.widget.EditText;
import android.widget.GridView;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.netease.financial.R;
import com.netease.financial.base.login.LoginPageViewModel;
import com.netease.financial.base.login.LoginViewModel;
import com.netease.financial.internal.di.components.DaggerRegisterComponent;
import com.netease.financial.internal.di.components.RegisterComponent;
import com.netease.financial.internal.di.modules.RegisterModule;
import com.netease.financial.ui.activity.BaseAppCompatActivity;

import butterknife.Bind;
import butterknife.ButterKnife;

public class RegisterActivity extends BaseAppCompatActivity implements RegisterView {

    private static final String TAG = RegisterActivity.class.getSimpleName();

    public static final String INTENT_EXTRA_KEY_CLIENT_ID = "clientId";
    public static final String INTENT_EXTRA_KEY_ACCESS_TOKEN = "accessToken";
    public static final String INTENT_EXTRA_KEY_USER_ID = "userId";
    @Bind(R.id.tv_nav_back)
    TextView tvNavBack;
    @Bind(R.id.tv_title)
    TextView tvTitle;
    @Bind(R.id.btn_right)
    ImageButton btnRight;
    @Bind(R.id.actionBarCustomerView)
    RelativeLayout actionBarCustomerView;
    @Bind(R.id.toolbar)
    Toolbar toolbar;
    @Bind(R.id.phoneNumber)
    EditText phoneNumber;
    @Bind(R.id.password)
    EditText password;
    @Bind(R.id.password_indicator)
    ImageView passwordIndicator;
    @Bind(R.id.verification_code)
    EditText verificationCode;
    @Bind(R.id.btn_get_sms_captcha)
    Button btnGetSmsCaptcha;
    @Bind(R.id.email)
    EditText email;
    @Bind(R.id.cb_agree)
    CheckBox cbAgree;
    @Bind(R.id.btn_sign_up)
    Button btnSignUp;
    @Bind(R.id.ll_main_content)
    LinearLayout llMainContent;
    @Bind(R.id.partners)
    GridView partners;
    @Bind(R.id.logos)
    ImageView logos;
    @Bind(R.id.logoContainer)
    RelativeLayout logoContainer;

    RegisterComponent registerComponent;

//    @Inject
//    RegisterPresenter registerPresenter;

    public static Intent getCallingIntent(Context context) {
        Intent intent = new Intent(context, RegisterActivity.class);
        return intent;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_register);
        ButterKnife.bind(this);
        initInjector();
    }

    private void initInjector() {
        registerComponent = DaggerRegisterComponent.builder()
                .applicationComponent(getApplicationComponent())
                .activityModule(getActivityModule())
                .registerModule(new RegisterModule())
                .build();
        registerComponent.inject(this);
    }

    @Override
    public void showLoading() {

    }

    @Override
    public void hideLoading() {

    }

    @Override
    public void onError(String message) {

    }

    @Override
    public void onSuccess(RegisterViewModel registerViewModel) {

    }

    @Override
    public void onSuccess(RegisterPageViewModel registerPageViewModel) {

    }

    @Override
    public Context getContext() {
        return this;
    }
}
